<!DOCTYPE HTML>
<html lang="cn" class="light sidebar-visible" dir="ltr">
    <head>
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>Cargo常用软件 - easy-to-code</title>


        <!-- Custom HTML head -->

        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="favicon.svg">
        <link rel="shortcut icon" href="favicon.png">
        <link rel="stylesheet" href="css/variables.css">
        <link rel="stylesheet" href="css/general.css">
        <link rel="stylesheet" href="css/chrome.css">
        <link rel="stylesheet" href="css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" id="highlight-css" href="highlight.css">
        <link rel="stylesheet" id="tomorrow-night-css" href="tomorrow-night.css">
        <link rel="stylesheet" id="ayu-highlight-css" href="ayu-highlight.css">

        <!-- Custom theme stylesheets -->


        <!-- Provide site root and default themes to javascript -->
        <script>
            const path_to_root = "";
            const default_light_theme = "light";
            const default_dark_theme = "navy";
        </script>
        <!-- Start loading toc.js asap -->
        <script src="toc.js"></script>
    </head>
    <body>
    <div id="mdbook-help-container">
        <div id="mdbook-help-popup">
            <h2 class="mdbook-help-title">Keyboard shortcuts</h2>
            <div>
                <p>Press <kbd>←</kbd> or <kbd>→</kbd> to navigate between chapters</p>
                <p>Press <kbd>S</kbd> or <kbd>/</kbd> to search in the book</p>
                <p>Press <kbd>?</kbd> to show this help</p>
                <p>Press <kbd>Esc</kbd> to hide this help</p>
            </div>
        </div>
    </div>
    <div id="body-container">
        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                let theme = localStorage.getItem('mdbook-theme');
                let sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
            let theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            const html = document.documentElement;
            html.classList.remove('light')
            html.classList.add(theme);
            html.classList.add("js");
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            let sidebar = null;
            const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            html.classList.remove('sidebar-visible');
            html.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <!-- populated by js -->
            <mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
            <noscript>
                <iframe class="sidebar-iframe-outer" src="toc.html"></iframe>
            </noscript>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search (`/`)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="/ s" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">easy-to-code</h1>

                    <div class="right-buttons">
                        <a href="print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="cargo常用软件安装"><a class="header" href="#cargo常用软件安装">Cargo常用软件安装</a></h1>
<p>常用命令</p>
<pre><code>// cargo watch 命令
cargo watch -c -x "build" -x "run --bin xxbin"

// 查看某个依赖关系
cargo tree -i ntapi

// 强制升级某个包升级到指定版本
cargo update -p wasm-bindgen --precise 0.2.95

// 强制升级某个特定版本的包升级到指定版本
cargo update -p ahash@0.8.6 --precise 0.8.7

cargo update -p serde --precise 1.0.195

// 重置所有依赖到最低版本，不错不错！！！
cargo update -Z minimal-versions

// 重置某个依赖到最低版本，不错不错！！！
cargo update -p proc-macro2 -Z minimal-versions

// 强制重置依赖版本，其他依赖也升级
cargo update -p wgpu-hal --aggressive

// wasm大法
cargo run --target wasm32-unknown-unknown

// wasm打包输出
wasm-bindgen --out-dir ./out/ --target web battle-city.wasm
</code></pre>
<p>一顿安装</p>
<pre><code class="language-rg">// 快速编译链接器
cargo install cargo-binutils

// 跨平台编译工具链
cargo install cargo-zigbuild

// 展开Rust宏代码并输出结果到标准输出
cargo install cargo-expand

// Rust代码检查器
cargo install bacon

// 网页打包工具
cargo install monolith

// 统计Rust代码中的行数、注释和空行
cargo install cargo-count

// 检查Cargo依赖是否存在安全漏洞
cargo install cargo-advisory

// Cargo依赖安全检查
cargo install cargo-deny

// 安装Rust代码审计工具
cargo install cargo-vet

// 帮助你检查项目的依赖项是否存在已知的安全漏洞
cargo install cargo-audit

// 生成Rust代码的汇编版本
cargo install cargo-show-asm

// 当项目文件变化时自动运行cargo指令
cargo install cargo-watch

// 后台代码自动监控检查工具
cargo install bacon

// 下载rust项目依赖的小工具，针对离线开发环境很好用
cargo install cargo-local-registry

// 自动化修复Rust项目中的一些lints和warnings
cargo install cargo-fix

// 比较Rust基准测试结果
cargo install cargo-benchcmp

// 允许你在Cargo.toml文件中添加、删除和更新依赖项。它提供了一种简单的方式来管理项目的依赖关系
cargo install cargo-edit

// 快速创建 Rust 项目、模块和文件的工具
cargo install cargo-generate

// 生成Rust依赖项的可视化图形
cargo install cargo-graph

// 使用适当的编译标志进行 “release” 编译，并将二进制文件上传到 GitHub 发布
cargo install cargo-release

// 自定义构建系统，基于 YAML 配置文件
cargo install cargo-make

// 快速配置cargo项目的编译时间、二进制打包大小
cargo install cargo-wizard

// 对cargo项目配置依赖排序
cargo install cargo-sort

// sea-orm小工具
cargo install sea-orm-cli

// bindgen小工具，将c代码转成rust绑定
cargo install bindgen-cli

// git管理小工具
cargo install gitu --locked

// 火焰图，用于分析性能
cargo install flamegraph

// 分析unsafe代码安全性，仅限linux系统
cargo install kani-verifier
cargo kani setup

// tauri开发小工具
cargo install create-tauri-app
cargo install trunk
cargo install tauri-cli

// 配合tauri开发纯rust项目
rustup target add wasm32-unknown-unknown

// wasm运行部署工具，你懂的
cargo install wasm-bindgen-cli
cargo install wasm-server-runner

// 分布式编译工具
cargo install sccache

// 交叉编译小工具，需要先安装docker才能交叉编译
cargo install cross

// 代码行数统计
cargo install tokei

// 高性能测试工具
cargo install cargo-nextest

// 性能测试工具
cargo install oha

// 检查rust代码语法错误小工具
cargo install typos-cli

// 跨平台GUN工具，具体怎么用我也不懂
cargo install coreutils

// 代码协议格式化小工具
cargo install hawkeye

// html打包小工具
cargo install monolith

// 快速打开md文件浏览
cargo install mdopen

// 将md文件生成电子书
cargo install mdbook

// 将mdbook转成pdf
cargo install mdbook-pdf

// sqlx命令行工具
cargo install sqlx-cli
</code></pre>

                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="Awesome_rust.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="Tauri_dev.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="Awesome_rust.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="Tauri_dev.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="elasticlunr.min.js"></script>
        <script src="mark.min.js"></script>
        <script src="searcher.js"></script>

        <script src="clipboard.min.js"></script>
        <script src="highlight.js"></script>
        <script src="book.js"></script>

        <!-- Custom JS scripts -->


    </div>
    </body>
</html>
